yjx.controller('userController',['$rootScope','$scope','$compile','$timeout','$fetch','modalService',function($rootScope,$scope,$compile,$timeout,$fetch,modalService){
    console.log("========================this is userController")
    $scope.summary="这个人很懒，什么也没留下...";
    /*限制最大字数56*/
    /*待办事项*/
    function getTodoList(){
        $fetch.fetch(
            '/pendingEvent/list',
            {
                params:{
                    userId:$rootScope.userId
                },
                cache:false,
            }
        ).then(function(data){
                $timeout(function(){
                    $rootScope.todoList = data
                    $scope.todoCount =   $rootScope.todoList?$rootScope.todoList.length:0;
                })
            }).catch(function(e){
                modalService.mainMsgError(e.msg);
            })
    }
    if($rootScope.userId){
        getTodoList();
    }
}])